package com.medisched.medisched.controller;

import com.medisched.medisched.domain.Shiftchange;
import com.medisched.medisched.service.IShiftchangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 调班记录Controller
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@CrossOrigin
@RestController
@RequestMapping("/system/shiftchange")
public class ShiftchangeController 
{
    @Autowired
    private IShiftchangeService shiftchangeService;

    /**
     * 查询调班记录列表
     */
    @GetMapping("/list")
    public  List<Shiftchange>  list(Shiftchange shiftchange)
    {
        List<Shiftchange> list = shiftchangeService.selectShiftchangeList(shiftchange);
        return (list);
    }


    /**
     * 获取调班记录详细信息
     */
    @GetMapping(value = "/{id}")
    public Shiftchange getInfo(@PathVariable("id") Long id)
    {
        return (shiftchangeService.selectShiftchangeById(id));
    }

    /**
     * 新增调班记录
     */
    @PostMapping
    public int add(@RequestBody Shiftchange shiftchange)
    {
        return (shiftchangeService.insertShiftchange(shiftchange));
    }

    /**
     * 修改调班记录
     */
    @PutMapping
    public int edit(@RequestBody Shiftchange shiftchange)
    {
        return (shiftchangeService.updateShiftchange(shiftchange));
    }

    /**
     * 删除调班记录
     */
	@DeleteMapping("/{ids}")
    public int remove(@PathVariable Long[] ids)
    {
        return (shiftchangeService.deleteShiftchangeByIds(ids));
    }
}
